package com.kuang.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @program: SpringMVC
 * @description:
 * @author: 陈恩涛
 * @create: 2020-08-01 07:04
 **/
@Controller  //代表这个类会被Spring托管，被Controller注解了的类中的所有方法，如果返回值是String,并且有具体的页面可以跳转，那么就会被视图解析器解析；
public class ControllerTest2 {

    @RequestMapping("/t2")
    public String test1(Model model) {
        model.addAttribute("msg","ControllerTest2");
        return "test"; //WEB-INF/jsp/test.jsp
    }

//    @RequestMapping("/t3")
//    public String test3(Model model) {
//        model.addAttribute("msg","ControllerTest3");
//        return "test"; //WEB-INF/jsp/test.jsp
//    }
}
